package com.example.property.controller;


import com.example.commons.core.exception.ServiceException;
import com.example.system.api.service.TestService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWorldController {

    @DubboReference
    private TestService testService;

    @RequestMapping("/")
    public String hello(){
        return "hello";
    }

    @RequestMapping("/dubbo")
    public String dubboHello() throws ServiceException {
        if(true){
            throw new ServiceException("用户/密码必须填写!");
        }
        return testService.helloDubbo();
    }
}
